package a.f.e;

import a.c.*;
import a.c.d;
import a.c.e;
import a.d.p;
import a.d.t;
import a.f.c.h;
import a.f.fc;
import a.f.gd;
import a.f.wb;
import a.f.xc;
import a.i.db;
import a.i.mb;

import java.util.HashMap;
import java.util.Map;

public abstract class b
  extends a
{
  public static final byte C = 0;
  public static final byte D = 1;
  public static final byte E = 2;
  public static final byte F = 3;
  public static final byte G = 4;
  a.c.n H;
  private static final double[][] I = { { 5.0D, 1.0D, 1.0D, 8.0D, 3.0D, 5.0D, 2.0D, 5.0D }, { 5.0D, 1.0D, 1.0D, 1.0D, 1.0D, 1.0D, 1.0D, 5.0D }, { 1.0D, 1.0D, 1.0D, 8.0D, 3.0D, 1.0D, 1.0D, 5.0D }, { 1.0D, 5.0D, 1.0D, 1.0D, 1.0D, 1.0D, 0.0D, 5.0D } };
  private static final byte J = 0;
  private static final byte K = 1;
  private static final byte L = 2;
  private static final byte M = 3;
  private static final byte N = 4;
  private static final byte O = 5;
  private static final byte P = 6;
  private static final byte Q = 7;
  private byte R = 0;
  private boolean S = true;
  private h T = null;
  private double U = 0.1D;
  protected a.f.o V;
  protected q W;
  protected x X;
  protected Map Y;
  protected x Z;
  public static boolean ab;
  
  public double o()
  {
    return this.U;
  }
  
  public void a(double paramDouble)
  {
    int j = a.B;
    int i = a.A;
    if (j == 0) {
      if (paramDouble > 1.0D)
      {
        this.U = 1.0D;
        if ((j == 0) && (i == 0)) {
          return;
        }
      }
    }
    if (j == 0)
    {
      if (paramDouble < 0.0D)
      {
        if (j != 0) {
          break label61;
        }
        this.U = 0.0D;
      }
    }
    else if (i == 0) {
      return;
    }
    label61:
    this.U = paramDouble;
  }
  
  public byte p()
  {
    return this.R;
  }
  
  public void a(byte paramByte)
  {
    int i = a.B;
    if (i == 0)
    {
      this.R = paramByte;
      if (paramByte == 4)
      {
        if (i != 0) {
          break label35;
        }
        this.S = false;
        if (a.A == 0) {
          return;
        }
      }
    }
    label35:
    this.S = true;
  }
  
  void e(a.f.o paramo, g[] paramArrayOfg)
  {
    int k = a.B;
    int j = a.A;
    this.V = paramo;
    this.Y = new HashMap();
    this.T = new h(paramo);
    gd localgd = b();
    boolean bool = this.s;
    try
    {
      if (k == 0)
      {
        if (this.R != 4) {
          a(g(paramArrayOfg));
        }
        b(paramArrayOfg);
        if (k != 0) {}
      }
      else if (this.S)
      {
        localObject1 = c(paramArrayOfg);
        int i = 0;
        do
        {
          if (i >= localObject1.length) {
            break;
          }
          localObject1[i].c();
          localObject1[i].b();
          g[] arrayOfg = localObject1[i].a();
          bb localbb = d(arrayOfg);
          a(arrayOfg, localbb);
          i++;
          if ((k == 0) && (j != 0)) {
            break label197;
          }
        } while (j == 0);
      }
      Object localObject1 = d(paramArrayOfg);
      if (k == 0)
      {
        a(paramArrayOfg, (bb)localObject1);
        this.W.o();
      }
      this.V = null;
    }
    finally
    {
      label197:
      a(localgd);
      this.s = bool;
      this.T.e();
    }
  }
  
  void a(a.f.o paramo, a.c.k paramk, int paramInt)
  {
    int k = a.B;
    int j = a.A;
    k localk = new k();
    int i = paramo.k() + paramo.m() + paramInt;
    if (k == 0)
    {
      if (i > 5000)
      {
        localk.c(20.0D);
        if (k != 0) {
          break label134;
        }
        if (j == 0) {
          break label102;
        }
      }
      if (k != 0) {}
    }
    else
    {
      if (i <= 1000) {
        break label94;
      }
      localk.c(10.0D);
    }
    if (k == 0)
    {
      if (j != 0) {
        label94:
        localk.c(5.0D);
      }
      label102:
      localk.b(35.0D);
      localk.a(5.0D);
      localk.b(true);
      localk.d(true);
    }
    label134:
    if (k == 0) {
      if (this.R != 0) {
        if (k != 0) {
          break label156;
        }
      }
    }
    label156:
    boolean bool = this.R == 4;
    localk.a(bool);
    localk.a(paramo, paramk);
  }
  
  void b(g[] paramArrayOfg)
  {
    this.W = new q();
    this.H = this.W.C();
    this.X = this.W.B();
    this.Z = this.W.B();
    f(paramArrayOfg);
    q();
  }
  
  private b_[] c(g[] paramArrayOfg)
  {
    int i3 = a.B;
    int i2 = a.A;
    x localx = this.W.B();
    e[] arrayOfe = new e[paramArrayOfg.length];
    int i = 0;
    do
    {
      while (i2 == 0)
      {
        if (i >= paramArrayOfg.length) {
          break;
        }
        arrayOfe[i] = this.W.i();
        localx.a(arrayOfe[i], true);
        i++;
      }
    } while (i3 != 0);
    Object localObject1 = this.W.v();
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      e locale = ((a.c.w)localObject1).d();
      if (i3 != 0) {
        break label169;
      }
      if (i2 != 0) {
        break label164;
      }
      if (!localx.getBool(locale))
      {
        int k = this.Z.getInt(locale);
        this.W.a(arrayOfe[k], locale);
      }
      ((a.c.w)localObject1).f();
    } while (i2 == 0);
    label164:
    label169:
    localObject1 = db.a(new int[this.W.k()]);
    int j = a.a.m.a(this.W, (x)localObject1);
    b_[] arrayOfb_ = new b_[j];
    int m = 0;
    do
    {
      do
      {
        if (m >= j) {
          break;
        }
        arrayOfb_[m] = new b_();
        m++;
      } while (i2 == 0);
    } while (i3 != 0);
    int[] arrayOfInt = new int[paramArrayOfg.length];
    a.c.w localw = this.W.v();
    Object localObject2;
    int i1;
    label382:
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        localObject2 = localw.d();
        if (i2 != 0) {
          break label408;
        }
        if (!localx.getBool(localObject2))
        {
          i1 = ((x)localObject1).getInt(localObject2);
          arrayOfInt[this.Z.getInt(localObject2)] = i1;
          arrayOfb_[i1].a((e)localObject2);
          a.c.m localm = ((e)localObject2).n();
          do
          {
            if (!localm.e()) {
              break label382;
            }
            d locald = localm.a();
            if (i2 != 0) {
              break;
            }
            if (((x)localObject1).getInt(locald.f()) == i1) {
              arrayOfb_[i1].a(locald);
            }
            localm.f();
          } while (i2 == 0);
        }
        localw.f();
      } while (i3 != 0);
    } while (i2 == 0);
    this.W.a(localx);
    label408:
    int n = 0;
    do
    {
      do
      {
        if (n >= paramArrayOfg.length) {
          break;
        }
        localObject2 = paramArrayOfg[n];
        i1 = arrayOfInt[n];
        arrayOfb_[i1].a((g)localObject2);
        n++;
        if (i3 != 0) {
          break label468;
        }
        if (i2 != 0) {
          break label466;
        }
      } while (i2 == 0);
    } while (i3 != 0);
    n = 0;
    label466:
    label468:
    do
    {
      while (i2 == 0)
      {
        if (n >= arrayOfe.length) {
          break;
        }
        this.W.a(arrayOfe[n]);
        n++;
      }
    } while (i3 != 0);
    return arrayOfb_;
  }
  
  abstract bb d(g[] paramArrayOfg);
  
  void a(g[] paramArrayOfg, bb parambb)
  {
    int k = a.B;
    int j = a.A;
    a.c.w localw = parambb.l();
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        g localg = paramArrayOfg[this.Z.getInt(localw.d())];
        fc localfc = (fc)this.X.get(localw.d());
        localfc.m();
        localg.a(true);
        localw.f();
      } while (j == 0);
    } while (k != 0);
    do
    {
      int i = 0;
      while (j == 0)
      {
        if (i >= paramArrayOfg.length) {
          break;
        }
        if (k == 0)
        {
          if (!paramArrayOfg[i].c()) {
            paramArrayOfg[i].e();
          }
          i++;
        }
      }
    } while (k != 0);
  }
  
  void f(g[] paramArrayOfg)
  {
    int k = a.B;
    int j = a.A;
    int i = 0;
    label143:
    label145:
    do
    {
      if (i >= paramArrayOfg.length) {
        break;
      }
      z localz = paramArrayOfg[i].b();
      if ((k != 0) || (localz != null))
      {
        a.c.y localy = localz.h();
        do
        {
          if (!localy.e()) {
            break;
          }
          fc localfc = (fc)localy.j();
          e locale = this.W.i();
          this.X.a(locale, localfc);
          this.Y.put(localfc, locale);
          this.Z.a(locale, i);
          localy.f();
          if (k != 0) {
            break label145;
          }
          if (j != 0) {
            break label143;
          }
        } while (j == 0);
      }
      if (k == 0) {
        i++;
      }
    } while (j == 0);
  }
  
  protected void q()
  {
    mb localmb = new mb();
    a.i.n.a(this, "create edges in conflict graph");
    f(this.V);
    a.i.n.a(this, "Time: " + localmb);
  }
  
  protected x r()
  {
    int j = a.B;
    int i = a.A;
    x localx = this.W.B();
    a.c.w localw = this.W.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      fc localfc = (fc)this.X.get(locale);
      if (j == 0)
      {
        if (i != 0) {
          break label98;
        }
        localx.a(locale, a(localfc) - localfc.p());
        localw.f();
      }
    } while (i == 0);
    label98:
    return localx;
  }
  
  private void f(a.f.o paramo)
  {
    int j = a.B;
    int i = a.A;
    z localz = new z();
    Object localObject1 = paramo.v();
    Object localObject2;
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.w)localObject1).d();
      localz.add(new a_(localObject2, paramo.v((e)localObject2), (byte)0));
      ((a.c.w)localObject1).f();
      if (j != 0) {
        break label248;
      }
      if (i != 0) {
        break label242;
      }
    } while (i == 0);
    Object localObject3;
    Object localObject4;
    if (j == 0)
    {
      localObject1 = paramo.w();
      label229:
      label231:
      do
      {
        if (!((a.c.m)localObject1).e()) {
          break;
        }
        localObject2 = ((a.c.m)localObject1).a();
        if (i != 0) {
          break label238;
        }
        localObject3 = paramo.n((d)localObject2).a();
        localObject4 = (a.d.w)((a.c.y)localObject3).j();
        ((a.c.y)localObject3).f();
        do
        {
          do
          {
            if (!((a.c.y)localObject3).e()) {
              break;
            }
            a.d.w localw = (a.d.w)((a.c.y)localObject3).j();
            localz.add(new a_(localObject2, new a.d.n((a.d.w)localObject4, localw), (byte)1));
            localObject4 = localw;
            ((a.c.y)localObject3).f();
            if (j != 0) {
              break label231;
            }
            if (i != 0) {
              break label229;
            }
          } while (i == 0);
        } while (j != 0);
        ((a.c.m)localObject1).f();
      } while (i == 0);
      label238:
      localObject1 = this.W.v();
      label242:
      label248:
      if (!((a.c.w)localObject1).e()) {
        break label417;
      }
    }
    label406:
    label414:
    label417:
    while (j != 0)
    {
      localObject2 = (fc)this.X.get(((a.c.w)localObject1).d());
      localObject3 = ((fc)localObject2).k();
      if ((j == 0) && (i != 0)) {
        return;
      }
      if (j == 0) {
        if ((localObject3 instanceof wb))
        {
          localObject4 = paramo.a((wb)localObject3);
          localz.add(new a_(localObject4, (fc)localObject2, (byte)2));
          if (j != 0) {
            break label414;
          }
          if (i == 0) {
            break label406;
          }
        }
      }
      if (j == 0) {
        if ((localObject3 instanceof xc))
        {
          localObject4 = paramo.a((xc)localObject3);
          localz.add(new a_(localObject4, (fc)localObject2, (byte)2));
          if (j != 0) {
            break label414;
          }
          if (i == 0) {
            break label406;
          }
        }
      }
      localz.add(new a_(null, (fc)localObject2, (byte)2));
      ((a.c.w)localObject1).f();
      if (i == 0) {
        break;
      }
    }
    a.d.m.a(localz, new c_());
  }
  
  double s()
  {
    return I[this.R][2];
  }
  
  gd g(g[] paramArrayOfg)
  {
    l locall = new l(paramArrayOfg, this.V);
    locall.b(I[this.R][0]);
    locall.d(I[this.R][1]);
    locall.g(I[this.R][4]);
    locall.e(I[this.R][3]);
    locall.h(I[this.R][5]);
    locall.c(I[this.R][6]);
    if (a.B == 0)
    {
      locall.i(I[this.R][7]);
      if (this.s)
      {
        locall.a(b());
        locall.a(this.U);
      }
    }
    return locall;
  }
  
  protected void a(fc paramfc1, fc paramfc2, d paramd)
  {
    if (this.R != 4)
    {
      double d = m.a(paramfc1.j(), paramfc2.j());
      this.H.a(paramd, d);
    }
  }
  
  protected void a(fc paramfc, e parame, t paramt)
  {
    int i = a.B;
    if (((i != 0) || (this.R != 4)) && (((i == 0) && (this.T == null)) || ((i != 0) || ((!this.T.e(parame)) && (a.d.o.a(paramfc.j(), paramt, 0.001D))))))
    {
      l locall = (l)b();
      locall.a(paramfc, parame, paramt);
    }
  }
  
  protected void a(fc paramfc, d paramd, a.d.n paramn)
  {
    if ((a.B != 0) || ((this.R != 4) && (a.d.o.a(paramfc.j(), paramn, 0.001D))))
    {
      l locall = (l)b();
      locall.a(paramfc, paramd, paramn);
    }
  }
  
  class c_
    implements m.g_
  {
    c_() {}
    
    public void a(Object paramObject1, Object paramObject2)
    {
      int j = a.B;
      int i = a.A;
      b.a_ locala_1 = (b.a_)paramObject1;
      b.a_ locala_2 = (b.a_)paramObject2;
      b.a_ locala_3 = null;
      b.a_ locala_4 = null;
      if (j == 0) {
        if (locala_1.d() == 2)
        {
          locala_3 = locala_1;
          locala_4 = locala_2;
          break label71;
        }
      }
      if ((j != 0) || (locala_2.d() == 2))
      {
        locala_3 = locala_2;
        locala_4 = locala_1;
      }
      label71:
      if ((j != 0) || (locala_3 != null))
      {
        fc localfc1 = locala_3.e();
        if (j == 0) {
          if (locala_4.d() == 0)
          {
            if (((j == 0) && (locala_3.b() == null)) || (locala_3.b() == locala_4.b())) {
              return;
            }
            b.this.a(localfc1, (e)locala_4.b(), locala_4.a());
            if (j == 0) {
              if (i == 0) {
                return;
              }
            }
          }
          else
          {
            if (j != 0) {
              break label175;
            }
          }
        }
        if (locala_4.d() == 2)
        {
          fc localfc2 = locala_4.e();
          e locale1 = (e)b.this.Y.get(localfc1);
          e locale2 = (e)b.this.Y.get(localfc2);
          d locald = b.this.W.a(locale1, locale2);
          if (j != 0) {
            break label268;
          }
          b.this.a(localfc1, localfc2, locald);
          if (i == 0) {
            return;
          }
        }
        b.this.a(localfc1, (d)locala_4.b(), (a.d.n)locala_4.c());
      }
      label175:
    }
  }
  
  static class a_
    implements p
  {
    static final byte a = 0;
    static final byte b = 1;
    static final byte c = 2;
    private fc d;
    private Object f;
    private p g;
    private byte i;
    
    a_(Object paramObject, p paramp, byte paramByte)
    {
      this.f = paramObject;
      this.g = paramp;
      this.i = paramByte;
      this.d = null;
    }
    
    a_(Object paramObject, fc paramfc, byte paramByte)
    {
      this.f = paramObject;
      this.d = paramfc;
      this.g = paramfc.a();
      this.i = paramByte;
    }
    
    public Object b()
    {
      return this.f;
    }
    
    public p c()
    {
      return this.g;
    }
    
    public byte d()
    {
      return this.i;
    }
    
    public fc e()
    {
      return this.d;
    }
    
    public t a()
    {
      return this.g.a();
    }
  }
  
  class b_
  {
    private bb a = new bb();
    private ab b = new ab();
    private z c = new z();
    
    public b_() {}
    
    public void a(e parame)
    {
      this.a.add(parame);
    }
    
    public void a(d paramd)
    {
      this.b.add(paramd);
    }
    
    public void a(g paramg)
    {
      this.c.add(paramg);
    }
    
    public String toString()
    {
      int k = a.B;
      int j = a.A;
      g[] arrayOfg = a();
      StringBuffer localStringBuffer = new StringBuffer();
      do
      {
        for (int i = 0; j == 0; i++)
        {
          if (i >= arrayOfg.length) {
            break;
          }
          if (j != 0) {
            break label79;
          }
          localStringBuffer.append(arrayOfg[i].toString() + "\n");
        }
      } while (k != 0);
      label79:
      return localStringBuffer.toString();
    }
    
    public g[] a()
    {
      int k = a.B;
      int j = a.A;
      g[] arrayOfg = new g[this.c.size()];
      int i = 0;
      do
      {
        a.c.y localy = this.c.h();
        while (j == 0)
        {
          if (!localy.e()) {
            break;
          }
          if ((k == 0) && (j != 0)) {
            break label82;
          }
          arrayOfg[(i++)] = ((g)localy.j());
          localy.f();
        }
      } while (k != 0);
      label82:
      return arrayOfg;
    }
    
    public void b()
    {
      int k = a.B;
      int j = a.A;
      int i = 0;
      a.c.y localy1 = this.c.h();
      label140:
      label142:
      do
      {
        if (!localy1.e()) {
          break;
        }
        g localg = (g)localy1.j();
        a.c.y localy2 = localg.b().h();
        do
        {
          do
          {
            if (!localy2.e()) {
              break;
            }
            fc localfc = (fc)localy2.j();
            e locale = (e)b.this.Y.get(localfc);
            b.this.Z.a(locale, i);
            localy2.f();
            if (k != 0) {
              break label142;
            }
            if (j != 0) {
              break label140;
            }
          } while (j == 0);
          i++;
        } while (k != 0);
        localy1.f();
      } while (j == 0);
    }
    
    public void c()
    {
      int j = a.B;
      int i = a.A;
      Object localObject = b.this.W.v();
      do
      {
        do
        {
          if (!((a.c.w)localObject).e()) {
            break;
          }
          b.this.W.d(((a.c.w)localObject).d());
          ((a.c.w)localObject).f();
          if (j != 0) {
            break label80;
          }
          if (i != 0) {
            break label74;
          }
        } while (i == 0);
      } while (j != 0);
      label74:
      label80:
      do
      {
        localObject = this.a.l();
        while (i == 0)
        {
          if (!((a.c.w)localObject).e()) {
            break;
          }
          if (i != 0) {
            break label118;
          }
          b.this.W.e(((a.c.w)localObject).d());
          ((a.c.w)localObject).f();
        }
      } while (j != 0);
      label118:
      do
      {
        localObject = this.b.l();
        while (i == 0)
        {
          if (!((a.c.m)localObject).e()) {
            break;
          }
          b.this.W.g(((a.c.m)localObject).a());
          ((a.c.m)localObject).f();
        }
      } while (j != 0);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.e.b

 * JD-Core Version:    0.7.0.1

 */